<script setup lang="ts">
import baseImg from '@/assets/img/logo.png'

import { computed, defineEmits } from 'vue'

const emit = defineEmits(['update:showModal'])

const props = defineProps({
  showModal: {
    type: Boolean,
    required: true,
    default: false,
  },
})
// 获取当前年份,用于显示版权信息
const year = computed(() => {
  let date = new Date()
  return date.getFullYear()
})
// 当前系统版本信息
const sysInfo = ref(__SYSTEM_INFO__)

function onClose() {
  emit('update:showModal', false)
}


</script>

<template>
  <n-modal
    :show="showModal"
    title="关于"
    style="width: 550px"
    preset="dialog"
    :show-icon="false"
    :mask-closable="false"
    class="about-dialog"
    @onClose="onClose"
  >
    <div class="body">
      <div class="about_box">
        <div class="terrace_info">
          <div class="logo_box">
            <img
              :src="baseImg"
              width="72"
              height="72"
              alt=""
            >
          </div>
          <div class="name">金合可视化平台</div>
          <div class="version">版本{{ sysInfo.version }}</div>
        </div>
      </div>
      <div class="copyright">
        <span>Copyright&nbsp;&nbsp;2020-{{ year }}&nbsp;&nbsp;</span>
        <a
          class="relation"
          href="https://www.ikingtech.com/"
          target="_blank"
        >陕西金合信息科技股份有限公司</a>
        <span>&nbsp;&nbsp;技术支持</span>
      </div>
    </div>
  </n-modal>
</template>

<style scoped lang="scss">
.about-dialog {
  .about_box {
    display: flex;
    padding: 25px 12px;
    margin: 0 auto;
    justify-content: center;
    height: 180px;
    .terrace_info {
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-around;
      width: 35%;
      .logo_box {
        width: 72px;
        height: 72px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background-color: #2b2b40;
        margin-bottom: 8px;
      }
      .name {
        font-size: 16px;
        color: #ffffffe6;
      }
      .version {
        font-size: 12px;
        color: #92929f;
      }
    }
  }
  .copyright {
    color: #92929f;
    font-size: 12px;
    margin: 0 auto;
    text-align: center;
    .relation {
      color: var(--datav-main-color);
      font-size: 12px;
      margin-bottom: 16px;
      cursor: pointer;
      text-decoration: none;
    }
  }
  .btn_row {
    display: flex;
    align-items: center;
    position: relative;
    width: 260px;
    height: 50px;
    .activeCode {
      display: flex;
      align-items: center;
    }
  }
}
</style>
